﻿@using System.Data;
@using System.Web;
@using DTcms.Web.MVC.Areas.Web.Controllers;
@using DTcms.Web.MVC.UI.Controllers;
@using DTcms.Model;
@{
   DTcms.Model.sites site = ViewData["site"] as DTcms.Model.sites;
   DTcms.Model.sysconfig config = ViewData["sysConfig"] as DTcms.Model.sysconfig;
   Layout = "~/Areas/Web/Views/" + site.build_path + "/Shared/_LayoutList.cshtml";
   Article_ListController bc = ViewBag.BasePage as Article_ListController;
   DTcms.Model.article_category m = ViewData["model"] as DTcms.Model.article_category;
   ViewBag.Title = m.title + " - " + site.name;
   string channel = "photo";
   int category_id = int.Parse(ViewBag.CategoryId as string);
   int pagesize = 20;
   int totalcount = 0;
   string pagelist = string.Empty;
   int page = int.Parse(ViewBag.Page as string);
}

<!--当前位置-->
@{string category_nav = bc.get_category_menu("photo_list", category_id);}
<div class="section">
  <div class="location">
    <span>当前位置：</span>
    <a href="@bc.linkurl("index")">首页</a> &gt;
        <a href="@bc.linkurl("video")">图片分享</a>
    @Html.Raw(category_nav)
  </div>
</div>
<!--/当前位置-->

<!--/分类导航-->
<div class="section">
  <div class="wrapper clearfix">
    <div class="screen-box">
      <ul>
        <h4>筛选类别：</h4>
        @if (category_id == 0) {
          <li class="selected"><a href="@bc.linkurl("photo_list", 0)">全部</a></li>
        }
        else {
          <li><a href="@bc.linkurl("photo_list", 0)">全部</a></li>
        }
        @{DataTable categoryList = bc.get_category_child_list(channel, m.parent_id > 0 ? m.parent_id : m.id);}
        @foreach (DataRow dr in categoryList.Rows) {
          if (Convert.ToInt32(dr["id"]) == category_id) {
          <li class="selected"><a href="@bc.linkurl("photo_list", dr["id"])">@dr["title"]</a></li>
                }
                else {
          <li><a href="@bc.linkurl("photo_list", dr["id"])">@dr["title"]</a></li>
                }
        }
      </ul>
    </div>
  </div>
</div>
<!--/分类导航-->

<!--内容列表-->
<div class="section">
  <div class="wrapper clearfix">
    <ul class="img-list">
      @{DataTable photoList = bc.get_article_list(channel, category_id, pagesize, page, "status=0", out totalcount, out pagelist, "photo_list", category_id, "__id__");}
      @foreach (DataRow dr in photoList.Rows) {
        <li>
          <a title="@dr["title"]" href="@bc.linkurl("photo_show", dr["id"])">
            <div class="img-box">
              <img src="@dr["img_url"]" /></div>
            <div class="abs-bg"></div>
            <div class="remark">
              <h3>@dr["title"]</h3>
              <p>@DateTime.Parse(dr["add_time"].ToString()).ToString("yyyy-MM-dd")</p>
            </div>
          </a>
        </li>
      }
    </ul>
    <!--页码列表-->
    <div class="page-box" style="margin: 15px 0px 0px;">
      <div class="digg">@Html.Raw(pagelist)</div>
    </div>
    <!--/页码列表-->
  </div>
</div>
<!--/分类推荐-->
